export interface Store {
  id: string
  storeName: string
  merchantId: string
  merchantName: string
  contactPerson: string
  contactPhone: string
  address: string
  businessHours: string
  status: 'active' | 'inactive' | 'pending'
  createTime: string
  storeType: string
  area: number
  employeeCount: number
  monthlyRevenue?: number
  description?: string
}

// 模拟数据
export const storeData: Store[] = [
  {
    id: 'STORE001',
    storeName: '智慧零售旗舰店',
    merchantId: 'MER001',
    merchantName: '智慧零售有限公司',
    contactPerson: '张店长',
    contactPhone: '13800138001',
    address: '北京市朝阳区建国路88号SOHO现代城B座1层',
    businessHours: '09:00-21:00',
    status: 'active',
    createTime: '2024-12-01 10:30:00',
    storeType: '旗舰店',
    area: 500,
    employeeCount: 25,
    monthlyRevenue: 850000,
    description: '主营高端数码产品和智能家居设备'
  },
  {
    id: 'STORE002',
    storeName: '智慧零售便民店',
    merchantId: 'MER001',
    merchantName: '智慧零售有限公司',
    contactPerson: '李副店长',
    contactPhone: '13800138002',
    address: '北京市朝阳区建国路90号社区底商',
    businessHours: '07:00-23:00',
    status: 'active',
    createTime: '2024-11-20 15:20:00',
    storeType: '便民店',
    area: 120,
    employeeCount: 8,
    monthlyRevenue: 180000,
    description: '主营日用百货和便民服务'
  },
  {
    id: 'STORE003',
    storeName: '云端科技体验店',
    merchantId: 'MER002',
    merchantName: '云端科技股份有限公司',
    contactPerson: '李经理',
    contactPhone: '13900139002',
    address: '上海市浦东新区张江路123号科技园A栋',
    businessHours: '10:00-22:00',
    status: 'active',
    createTime: '2024-11-15 14:20:00',
    storeType: '体验店',
    area: 300,
    employeeCount: 15,
    monthlyRevenue: 620000,
    description: '展示最新科技产品和解决方案'
  },
  {
    id: 'STORE004',
    storeName: '云端科技售后中心',
    merchantId: 'MER002',
    merchantName: '云端科技股份有限公司',
    contactPerson: '王技术总监',
    contactPhone: '13900139003',
    address: '上海市浦东新区张江路125号科技园B栋',
    businessHours: '09:00-18:00',
    status: 'inactive',
    createTime: '2024-10-30 11:00:00',
    storeType: '服务中心',
    area: 200,
    employeeCount: 12,
    description: '提供技术支持和设备维修服务，暂时停业装修中'
  },
  {
    id: 'STORE005',
    storeName: '美食天下中央店',
    merchantId: 'MER003',
    merchantName: '美食天下餐饮管理有限公司',
    contactPerson: '王店长',
    contactPhone: '13700137003',
    address: '广州市天河区珠江路456号天河城3楼',
    businessHours: '11:00-23:00',
    status: 'active',
    createTime: '2024-10-20 16:45:00',
    storeType: '主题餐厅',
    area: 800,
    employeeCount: 45,
    monthlyRevenue: 1200000,
    description: '高端主题餐厅，提供粤菜和川菜'
  },
  {
    id: 'STORE006',
    storeName: '美食天下快餐店',
    merchantId: 'MER003',
    merchantName: '美食天下餐饮管理有限公司',
    contactPerson: '陈店长',
    contactPhone: '13700137004',
    address: '广州市天河区珠江路458号写字楼1楼',
    businessHours: '07:00-22:00',
    status: 'pending',
    createTime: '2024-12-10 09:30:00',
    storeType: '快餐店',
    area: 150,
    employeeCount: 10,
    description: '新开业门店，正在办理相关证照'
  },
  {
    id: 'STORE007',
    storeName: '时尚服装旗舰店',
    merchantId: 'MER004',
    merchantName: '时尚服装贸易公司',
    contactPerson: '赵店长',
    contactPhone: '13600136004',
    address: '深圳市福田区华强北路789号商业广场2楼',
    businessHours: '10:00-22:00',
    status: 'active',
    createTime: '2024-09-15 12:00:00',
    storeType: '服装店',
    area: 400,
    employeeCount: 20,
    monthlyRevenue: 450000,
    description: '主营时尚女装和配饰'
  },
  {
    id: 'STORE008',
    storeName: '绿色农产品直营店',
    merchantId: 'MER005',
    merchantName: '绿色农产品合作社',
    contactPerson: '孙主任',
    contactPhone: '13500135005',
    address: '杭州市西湖区文一路321号农贸市场内',
    businessHours: '06:00-18:00',
    status: 'active',
    createTime: '2024-08-20 08:00:00',
    storeType: '农产品店',
    area: 80,
    employeeCount: 5,
    monthlyRevenue: 95000,
    description: '销售有机蔬菜和本地特色农产品'
  }
]

export const statusOptions = [
  { label: '正常营业', value: 'active', color: 'success' },
  { label: '暂停营业', value: 'inactive', color: 'error' },
  { label: '待审核', value: 'pending', color: 'warning' }
]

export const storeTypeOptions = [
  '旗舰店',
  '体验店',
  '便民店',
  '服务中心',
  '主题餐厅',
  '快餐店',
  '服装店',
  '农产品店',
  '其他'
]

// 根据商户ID获取门店列表
export const getStoresByMerchantId = (merchantId: string): Store[] => {
  return storeData.filter(store => store.merchantId === merchantId)
}

// 根据状态获取门店数量统计
export const getStoreCountByStatus = () => {
  const stats = {
    active: 0,
    inactive: 0,
    pending: 0
  }

  storeData.forEach(store => {
    stats[store.status]++
  })

  return stats
}

// 获取门店类型分布
export const getStoreTypeDistribution = () => {
  const distribution: Record<string, number> = {}

  storeData.forEach(store => {
    distribution[store.storeType] = (distribution[store.storeType] || 0) + 1
  })

  return distribution
}